{% extends "sentry/projects/manage.html" %}

{% load crispy_forms_tags %}
{% load i18n %}
{% load sentry_helpers %}

{% block title %}{% trans "Rate Limits" %} | {{ block.super }}{% endblock %}

{% block main %}
    <h2>{% trans "Rate Limits" %}</h2>

    <form action="" method="post" class="form-stacked">
        <p>{% blocktrans %}With the nature of Sentry, sometimes the amount of data collected can be overwhelming. You can set rate limits per-project to ensure that a single flood of errors won't affect any other projects utilizing Sentry.{% endblocktrans %}</p>

        <p>{% blocktrans %}Rate limits apply on a per-minute basis, which means that they rollover at the start of a new minute. When you attempt to send an event and the project is over its quota, the client will receive an HTTP 429 (Too Many Requests) response.{% endblocktrans %}</p>

        {% if not has_quotas %}
            <p><strong>{% blocktrans %}Note: The Sentry application is not configured to manage rate limits.{% endblocktrans %}</strong></p>
        {% elif system_quota %}
            <p>{% blocktrans %}The Sentry system has <strong>{{ system_quota }} events per minute</strong> allocated collectively among projects.{% endblocktrans %}</p>
        {% endif %}

        {% csrf_token %}

        {{ form|as_crispy_errors }}

        <div class="box">
          <div class="box-content with-padding">
            {% for field in form %}
                {{ field|as_crispy_field }}
            {% endfor %}
          </div>
        </div>

        <fieldset class="form-actions">
            <button type="submit" class="btn btn-primary btn-lg">{% trans "Save Changes" %}</button>
        </fieldset>
    </form>
{% endblock %}
